﻿<%@ WebHandler Language="C#" Class="Search" %>

using System;
using System.Web;

public class Search : IHttpHandler
{

    String sxOutput = String.Empty;

    public void ProcessRequest(HttpContext ctx)
    {
        string sxTools = ctx.ReadQuery("Tools");
        string sxAction = ctx.ReadQuery("searchText");
        
        if (sxTools.Equals("ContactPerson"))
        {
            Cached.ContactPersonTable cachedCP = new Cached.ContactPersonTable();

            sxOutput = cachedCP.searchContactPerson(sxAction, true);

            ctx.Response.ContentType = "text/plain";
            ctx.Response.Write(sxOutput);
        }
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }

}